-
Notifications
You must be signed in to change notification settings - Fork 253
LEARNER-9767 Create mobile skus for courses #4088
Conversation
course_keys = input_file.readlines() | ||
for course_key in course_keys: | ||
payload = json.dumps({"courses": [course_key]}) | ||
response = requests.post(create_skus_url, data=payload, headers=headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we double the default timeout of requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are processing a single course in one request, are you sure we should double the request timeout?
def _update_response_dictionary(self, new_response, complete_response): | ||
""" Update the complete_response dict with the contents of the new response """ | ||
if new_response.get(NEW_MOBILE_SKUS_KEY): | ||
new_mobile_skus = new_response.get(NEW_MOBILE_SKUS_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add if here we can use these lines:
complete_response.update(new_response[NEW_MOBILE_SKUS_KEY])
complete_response[FAILED_COURSE_IDS_KEY].extend(new_response[FAILED_COURSE_IDS_KEY])
complete_response[MISSING_COURSE_RUNS_KEY].extend(new_response[MISSING_COURSE_RUNS_KEY])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dict.update
does not append, but replaces in the second level of the dict. hence not using it.
""" Update the complete_response dict with the contents of the new response """ | ||
if new_response.get(NEW_MOBILE_SKUS_KEY): | ||
new_mobile_skus = new_response.get(NEW_MOBILE_SKUS_KEY) | ||
for key, value in new_mobile_skus.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we adjust this script to include another array for ios errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, done.
⛔️ MAIN BRANCH WARNING! 2U EMPLOYEES must make branches against the 2u/main BRANCH
⛔️ DEPRECATION WARNING
This repository is deprecated and in maintainence-only operation while we work on a replacement, please see this announcement for more information.
Although we have stopped integrating new contributions, we always appreciate security disclosures and patches sent to [email protected]
Anyone internally merging to this repository is expected to release and monitor their changes; if you are not able to do this DO NOT MERGE, please coordinate with someone who can to ensure that the changes are released.
Required Testing
(^ We can remove that manual check once REV-2624 is done and the corresponding e2e test runs again)
Description
Describe what this pull request changes, and why these changes were made. How will these changes affect other people, installations of edx, etc.?
Please include links to any relevant ADRs, design artifacts, and decision documents. Make sure to document the rationale behind significant changes in the repo, per OEP-19, and can be
linked here.
Useful information to include:
Supporting information
Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for testing this change; how did YOU test this change?
Other information
Include anything else that will help reviewers and consumers understand the change.